//
//  ZHDrawerController.m
//  ZHS_UCDemo
//
//  Created by Emrys on 2016/11/10.
//  Copyright © 2016年 Emrys. All rights reserved.
//

#import "ZHDrawerController.h"

#import "ZHDrawerMenuController.h"

#import "ZHMainController.h"
#import "ZHNavigationController.h"

@interface ZHDrawerController ()

@end

@implementation ZHDrawerController

+ (instancetype)drawerControllerWithLeaderSymbol:(NSInteger)leaderSymbol {
    
    ZHNavigationController *mainNavCrl = [[ZHNavigationController alloc] initWithRootViewController:[ZHMainController viewControllerFromStoryboard]];
    
    ZHDrawerMenuController *drawerMenuVC = [ZHDrawerMenuController drawerMenuControllerWithLeaderSymbol:leaderSymbol];
    
    ZHDrawerController *drawerVC = [[ZHDrawerController alloc] initWithCenterViewController:mainNavCrl
                                                                   leftDrawerViewController:drawerMenuVC];
    
    if (drawerVC) {
        
        [drawerVC setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll];
        [drawerVC setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];
        
        drawerMenuVC.drawerController = drawerVC;
        
        return drawerVC;
    }
    return nil;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
